/*
 *  input.cpp
 *  breemlib
 *
 *  Created by James on 8/4/08.
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
 *
 */

#include "input.h"
#include "StdAfx.h"

CInput::CInput()
{
}

u32 CInput::Get()
{
return(input);
}

int CInput::GetKey(int n)							//returns key mapped for n
{
	int i;
			
	for(i=0;i<MAX_KEYS;i++) {
		if(settings.keyconfig[i].internalcode == n)
			return(settings.keyconfig[i].scancode);
	}
	return(0);
}

void CInput::SetKey(int n,int scancode)		//maps key for n
{
	int i;
			
	for(i=0;i<MAX_KEYS;i++) {
		if(settings.keyconfig[i].internalcode == n) {
			settings.keyconfig[i].scancode = scancode;
			return;
		}
	}
	message("CInput::SetKey: bug: internalcode not found ($%08X)",n);
}